﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<photogalleryMVC.Models.AlbumDetailModel>" %>
<%@ Import Namespace="PhotgalleryEntities.Interfaces" %>
<%@ Import Namespace="PhotoGalleryEnteties" %>
<%@ Import Namespace="photogalleryMVC" %>
<%@ Import Namespace="photogalleryMVC.Models" %>   
         

         <%if(Model.TotalPages >1){ %>
          <div class ="pager">
              <%=Html.PageLinks(Model.CurrentPage, Model.TotalPages,i =>Url.RouteUrl(new{controller = "Album",action = "Details",id = Model.AlbumId,page = i}))%>
          </div><%} %>
         <div class="container" >      
            <div class="Page">
                <% foreach (IAlbumItem content in Model.Content)
                   {
               
                       if (content is Album)
                       {
                           Html.RenderPartial("AlbumPartialView", content);
                       }

                       if (content is PhotoInfo )
                       {
                           Html.RenderPartial("PhotoPartialView", content);
                       }

                   }%>
               </div>
          </div> 
          <%if (Model.TotalPages > 1){%>
          <div class ="pager">
              <%=Html.PageLinks(Model.CurrentPage, Model.TotalPages,i =>Url.RouteUrl(new{controller = "Album",action = "Details",id = Model.AlbumId,page = i}))%>
          </div>
          <%}%>

